from django.db import models


class User(models.Model):
    username = models.CharField(max_length=20)
    password = models.CharField(max_length=20)
    avatar = models.ImageField('用户头像', upload_to='avatar/',
                               default='avatar/default_avatar.jpg', blank=True, null=True)
    email = models.EmailField()
    is_administrator = models.BooleanField(default=False)

    class Meta:
        ordering = ('username', )
